from excel.app import run
from excel.config import ExcelConfig
import os


def RenameUi(dir="excel/ui"):
    """
    把 make uic 生成的 '.ui.py' 更改为 '_ui.py'
    """
    for r, dirs, files in os.walk(dir):
        for f in files:
            ext = f.split(".")
            if ext[-2] == "ui" and ext[-1] == "py":
                name = ext[0] + "_ui.py"
                os.rename(os.path.join(r, f), os.path.join(r, name))


def genclients():
    filename = r"C:\Users\Administrator\Desktop\工作簿1.xlsx"
    ExcelConfig.GenClients(filename)


if __name__ == "__main__":
    run()
    # genclients()

    # RenameUi() # 需注释掉第一行方可
